import Vue from "vue"
/**
 * 全局过滤器
 */
/**
 * 根据 code 获取 label
 */
import contractApi from '@/api/contract'
Vue.filter('getContractType', function (value) {
    console.log('value666:',value)
    if (!value) return false
    let name = ''
    contractApi.getContractType().then(res => {
        console.log('res66666666:',res)
        let contractTypeData = res.data;
        
        if(contractTypeData.length){
            contractTypeData.map(item => {
                if(item.id==value){
                    name = item.type_name;
                    console.log('name:',name)
                }
            })
            return name
        }
        
    })
  
})